﻿using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using IntelligentAgriculture.Domain.Entity;

namespace IntelligentAgriculture.Domain
{
    public partial class AgricultureDbContext : DbContext
    {
        public AgricultureDbContext()
        {
        }

        public AgricultureDbContext(DbContextOptions<AgricultureDbContext> options)
            : base(options)
        {
        }

        public virtual DbSet<Appearancemodel> Appearancemodels { get; set; } = null!;
        public virtual DbSet<Area> Areas { get; set; } = null!;
        public virtual DbSet<Bodymeasuremodel> Bodymeasuremodels { get; set; } = null!;
        public virtual DbSet<Breedinginfo> Breedinginfos { get; set; } = null!;
        public virtual DbSet<Breedingweigh> Breedingweighs { get; set; } = null!;
        public virtual DbSet<Certificate> Certificates { get; set; } = null!;
        public virtual DbSet<Childbirth> Childbirths { get; set; } = null!;
        public virtual DbSet<City> Cities { get; set; } = null!;
        public virtual DbSet<Columnmanagement> Columnmanagements { get; set; } = null!;
        public virtual DbSet<Contact> Contacts { get; set; } = null!;
        public virtual DbSet<Customerinformation> Customerinformations { get; set; } = null!;
        public virtual DbSet<Deathmodel> Deathmodels { get; set; } = null!;
        public virtual DbSet<Deliverypromptmodel> Deliverypromptmodels { get; set; } = null!;
        public virtual DbSet<Department> Departments { get; set; } = null!;
        public virtual DbSet<Descendanttransfer> Descendanttransfers { get; set; } = null!;
        public virtual DbSet<Eartag> Eartags { get; set; } = null!;
        public virtual DbSet<Eartagormarkid> Eartagormarkids { get; set; } = null!;
        public virtual DbSet<Educationalexperience> Educationalexperiences { get; set; } = null!;
        public virtual DbSet<Eleartag> Eleartags { get; set; } = null!;
        public virtual DbSet<Eleartagoreartag> Eleartagoreartags { get; set; } = null!;
        public virtual DbSet<Eliminationmodel> Eliminationmodels { get; set; } = null!;
        public virtual DbSet<Emergencycontact> Emergencycontacts { get; set; } = null!;
        public virtual DbSet<Entryinformation> Entryinformations { get; set; } = null!;
        public virtual DbSet<Familyrelationship> Familyrelationships { get; set; } = null!;
        public virtual DbSet<Gestationpromptmodel> Gestationpromptmodels { get; set; } = null!;
        public virtual DbSet<Historyrecord> Historyrecords { get; set; } = null!;
        public virtual DbSet<Hybridizationpromptmodel> Hybridizationpromptmodels { get; set; } = null!;
        public virtual DbSet<Lambweaninginfo> Lambweaninginfos { get; set; } = null!;
        public virtual DbSet<Management> Managements { get; set; } = null!;
        public virtual DbSet<Permission> Permissions { get; set; } = null!;
        public virtual DbSet<Personnel> Personnel { get; set; } = null!;
        public virtual DbSet<Promptmodel> Promptmodels { get; set; } = null!;
        public virtual DbSet<Province> Provinces { get; set; } = null!;
        public virtual DbSet<Purchaseformmodel> Purchaseformmodels { get; set; } = null!;
        public virtual DbSet<Ridgepole> Ridgepoles { get; set; } = null!;
        public virtual DbSet<Ridgepoletype> Ridgepoletypes { get; set; } = null!;
        public virtual DbSet<Role> Roles { get; set; } = null!;
        public virtual DbSet<Rolepermission> Rolepermissions { get; set; } = null!;
        public virtual DbSet<Selfevaluation> Selfevaluations { get; set; } = null!;
        public virtual DbSet<SheepMarking> SheepMarkings { get; set; } = null!;
        public virtual DbSet<Sheepablactation> Sheepablactations { get; set; } = null!;
        public virtual DbSet<Sheepfactory> Sheepfactories { get; set; } = null!;
        public virtual DbSet<Sheepfilemodel> Sheepfilemodels { get; set; } = null!;
        public virtual DbSet<Sheeppregnancy> Sheeppregnancies { get; set; } = null!;
        public virtual DbSet<Sheeprescission> Sheeprescissions { get; set; } = null!;
        public virtual DbSet<Sheepsalemodel> Sheepsalemodels { get; set; } = null!;
        public virtual DbSet<Start> Starts { get; set; } = null!;
        public virtual DbSet<Unit> Units { get; set; } = null!;
        public virtual DbSet<Userinfo> Userinfos { get; set; } = null!;
        public virtual DbSet<Userrole> Userroles { get; set; } = null!;
        public virtual DbSet<Vendormodel> Vendormodels { get; set; } = null!;
        public virtual DbSet<Workexperience> Workexperiences { get; set; } = null!;

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
                optionsBuilder.UseMySql("server=10.31.60.6;uid=root;pwd=123456;database=intelligentagriculture_db", Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.22-mysql"));
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseCollation("utf8mb4_general_ci")
                .HasCharSet("utf8mb4");

            modelBuilder.Entity<Appearancemodel>(entity =>
            {
                entity.HasKey(e => e.AppearanceId)
                    .HasName("PRIMARY");

                entity.ToTable("appearancemodel");

                entity.Property(e => e.AppearanceId).HasColumnType("int(11)");

                entity.Property(e => e.Angle).HasColumnType("int(11)");

                entity.Property(e => e.BuildingManagementId).HasColumnType("int(11)");

                entity.Property(e => e.ColumnManagementId).HasColumnType("int(11)");

                entity.Property(e => e.CreateBy).HasMaxLength(30);

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.FatDistribution).HasColumnType("int(11)");

                entity.Property(e => e.Hair).HasColumnType("int(11)");

                entity.Property(e => e.HoofColor).HasColumnType("int(11)");

                entity.Property(e => e.LogicalDeletion).HasColumnType("bit(1)");

                entity.Property(e => e.MeasureAge).HasColumnType("int(11)");

                entity.Property(e => e.MeasureDate).HasColumnType("datetime");

                entity.Property(e => e.MouthColor).HasColumnType("int(11)");

                entity.Property(e => e.SheepRescissionSex).HasColumnType("bit(1)");

                entity.Property(e => e.Stain).HasColumnType("int(11)");

                entity.Property(e => e.Tooth).HasColumnType("int(11)");

                entity.Property(e => e.UpdateBy).HasMaxLength(30);

                entity.Property(e => e.UpdateDate).HasColumnType("datetime");

                entity.Property(e => e.Variety).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Area>(entity =>
            {
                entity.ToTable("area");

                entity.Property(e => e.AreaId).HasColumnType("int(11)");

                entity.Property(e => e.AreaName).HasMaxLength(30);

                entity.Property(e => e.CityId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Bodymeasuremodel>(entity =>
            {
                entity.HasKey(e => e.BodyMeasureId)
                    .HasName("PRIMARY");

                entity.ToTable("bodymeasuremodel");

                entity.Property(e => e.BodyMeasureId).HasColumnType("int(11)");

                entity.Property(e => e.Backfat).HasPrecision(10);

                entity.Property(e => e.BodyLength).HasPrecision(10);

                entity.Property(e => e.Chest).HasPrecision(10);

                entity.Property(e => e.ColumnManagementId).HasColumnType("int(11)");

                entity.Property(e => e.CreateName).HasMaxLength(30);

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.EyeMuscleArea).HasPrecision(10);

                entity.Property(e => e.EyeMuscleWidth).HasPrecision(10);

                entity.Property(e => e.Height).HasPrecision(10);

                entity.Property(e => e.Isdelete).HasColumnType("bit(1)");

                entity.Property(e => e.MeasureAge).HasColumnType("int(11)");

                entity.Property(e => e.MeasureDate).HasColumnType("datetime");

                entity.Property(e => e.Oschea).HasPrecision(10);

                entity.Property(e => e.RidgepoleId).HasColumnType("int(11)");

                entity.Property(e => e.SheepRescissionSex).HasColumnType("bit(1)");

                entity.Property(e => e.Tube).HasPrecision(10);

                entity.Property(e => e.UpdateName).HasMaxLength(30);

                entity.Property(e => e.UpdateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UpdateTIme");

                entity.Property(e => e.Variety).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Breedinginfo>(entity =>
            {
                entity.HasKey(e => e.BreedId)
                    .HasName("PRIMARY");

                entity.ToTable("breedinginfo");

                entity.Property(e => e.BreedId).HasColumnType("int(11)");

                entity.Property(e => e.BreedDate).HasColumnType("datetime");

                entity.Property(e => e.BreedState).HasColumnType("int(11)");

                entity.Property(e => e.BreedStyle).HasColumnType("int(11)");

                entity.Property(e => e.CreateName)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.CurrentBuilding).HasColumnType("int(11)");

                entity.Property(e => e.CurrentField).HasColumnType("int(11)");

                entity.Property(e => e.DocumentNumber)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.EarTag)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.EventDate).HasColumnType("datetime");

                entity.Property(e => e.FirstMatingRam).HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.FirstScore)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.Isdel).HasColumnType("bit(1)");

                entity.Property(e => e.LastBreedDate).HasColumnType("datetime");

                entity.Property(e => e.MaleBreed).HasColumnType("int(11)");

                entity.Property(e => e.MotherVariety).HasColumnType("int(11)");

                entity.Property(e => e.OestrusType).HasColumnType("int(11)");

                entity.Property(e => e.ToBuildingManageId).HasColumnType("int(11)");

                entity.Property(e => e.ToColumMangementId).HasColumnType("int(11)");

                entity.Property(e => e.UpdateName)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.UpdateTime).HasColumnType("datetime");

                entity.Property(e => e.UserId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Breedingweigh>(entity =>
            {
                entity.HasKey(e => e.BreedingId)
                    .HasName("PRIMARY");

                entity.ToTable("breedingweigh");

                entity.Property(e => e.BreedingId)
                    .HasColumnType("int(11)")
                    .HasColumnName("BreedingID");

                entity.Property(e => e.CreateName).HasMaxLength(30);

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.Isdelete).HasColumnType("bit(1)");

                entity.Property(e => e.SheepRescissionSex).HasColumnType("bit(1)");

                entity.Property(e => e.UpdateName).HasMaxLength(30);

                entity.Property(e => e.UpdateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UpdateTIme");

                entity.Property(e => e.Variety).HasColumnType("int(11)");

                entity.Property(e => e.WeighCategory).HasColumnType("int(11)");

                entity.Property(e => e.WeighDate).HasColumnType("datetime");

                entity.Property(e => e.Weight).HasPrecision(10);

                entity.Property(e => e.WeightMonthsAge).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Certificate>(entity =>
            {
                entity.ToTable("certificate");

                entity.Property(e => e.CertificateId).HasColumnType("int(11)");

                entity.Property(e => e.Authority).HasMaxLength(30);

                entity.Property(e => e.AuthorityDate).HasColumnType("datetime");

                entity.Property(e => e.CertificateCode).HasMaxLength(30);

                entity.Property(e => e.CertificateName).HasMaxLength(30);

                entity.Property(e => e.CertificateType).HasMaxLength(30);

                entity.Property(e => e.EffectiveDate).HasColumnType("datetime");
            });

            modelBuilder.Entity<Childbirth>(entity =>
            {
                entity.ToTable("childbirth");

                entity.Property(e => e.ChildbirthId)
                    .HasColumnType("int(11)")
                    .HasComment("主键自增");

                entity.Property(e => e.AuditDate)
                    .HasColumnType("datetime")
                    .HasComment("审核时间");

                entity.Property(e => e.AuditName)
                    .HasMaxLength(50)
                    .HasComment("审核人");

                entity.Property(e => e.BroodNumber)
                    .HasMaxLength(50)
                    .HasComment("窝号")
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.BroodWeight)
                    .HasPrecision(10)
                    .HasComment("窝总羔数");

                entity.Property(e => e.ChildbirthDate)
                    .HasColumnType("datetime")
                    .HasComment("分娩日期");

                entity.Property(e => e.CreateName)
                    .HasMaxLength(50)
                    .HasComment("创建人")
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasComment("创建时间");

                entity.Property(e => e.CurrentBuilding)
                    .HasColumnType("int(11)")
                    .HasComment("当前栋舍");

                entity.Property(e => e.CurrentField)
                    .HasColumnType("int(11)")
                    .HasComment("当前栏位");

                entity.Property(e => e.DieLambAvgWeight)
                    .HasPrecision(10)
                    .HasComment("死羔均重");

                entity.Property(e => e.DieLambNum)
                    .HasColumnType("int(11)")
                    .HasComment("死羔总数");

                entity.Property(e => e.DieLambWeight)
                    .HasPrecision(10)
                    .HasComment("死羔总重");

                entity.Property(e => e.DifficultyDelivery)
                    .HasColumnType("int(11)")
                    .HasComment("分娩难易");

                entity.Property(e => e.DocumentNumber)
                    .HasMaxLength(50)
                    .HasComment("单据号")
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.EarTag)
                    .HasMaxLength(50)
                    .HasComment("耳号")
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.FatSheep)
                    .HasColumnType("int(11)")
                    .HasComment("肥羊批次");

                entity.Property(e => e.FreaksNumber)
                    .HasColumnType("int(11)")
                    .HasComment("畸胎数");

                entity.Property(e => e.GestationDays)
                    .HasColumnType("int(11)")
                    .HasComment("妊娠天数");

                entity.Property(e => e.HealthyNumber)
                    .HasColumnType("int(11)")
                    .HasComment("健羔数");

                entity.Property(e => e.Isdel)
                    .HasColumnType("bit(1)")
                    .HasComment("逻辑删除");

                entity.Property(e => e.Lactation)
                    .HasColumnType("int(11)")
                    .HasComment("泌乳");

                entity.Property(e => e.LambNumber)
                    .HasColumnType("int(11)")
                    .HasComment("弱羔数");

                entity.Property(e => e.LitterWeight)
                    .HasColumnType("int(11)")
                    .HasComment("窝总重（公斤）");

                entity.Property(e => e.LiveLambAvgWeight)
                    .HasPrecision(10)
                    .HasComment("活羔均重");

                entity.Property(e => e.LiveLambNum)
                    .HasColumnType("int(11)")
                    .HasComment("活羔数");

                entity.Property(e => e.LiveLambWeight)
                    .HasPrecision(10)
                    .HasComment("活羔总重");

                entity.Property(e => e.LiveNumber)
                    .HasColumnType("int(11)")
                    .HasComment("活羔数");

                entity.Property(e => e.MalformationNumber)
                    .HasColumnType("int(11)")
                    .HasComment("畸形数");

                entity.Property(e => e.Mastitis)
                    .HasColumnType("int(11)")
                    .HasComment("乳房炎");

                entity.Property(e => e.MotherHood)
                    .HasColumnType("int(11)")
                    .HasComment("母性");

                entity.Property(e => e.MummyNumber)
                    .HasColumnType("int(11)")
                    .HasComment("木乃伊数");

                entity.Property(e => e.Sex)
                    .HasColumnType("bit(1)")
                    .HasComment("性别");

                entity.Property(e => e.StillbirthNumber)
                    .HasColumnType("int(11)")
                    .HasComment("死胎数");

                entity.Property(e => e.ToBuildingManageId)
                    .HasColumnType("int(11)")
                    .HasComment("转入栋舍");

                entity.Property(e => e.ToColumMangementId)
                    .HasColumnType("int(11)")
                    .HasComment("转入栏位");

                entity.Property(e => e.UpdateName)
                    .HasMaxLength(50)
                    .HasComment("修改人")
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.UpdateTime)
                    .HasColumnType("datetime")
                    .HasComment("修改时间");

                entity.Property(e => e.UserId)
                    .HasColumnType("int(11)")
                    .HasComment("负责人");
            });

            modelBuilder.Entity<City>(entity =>
            {
                entity.ToTable("city");

                entity.Property(e => e.CityId).HasColumnType("int(11)");

                entity.Property(e => e.CityName).HasMaxLength(30);

                entity.Property(e => e.ProVinceId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Columnmanagement>(entity =>
            {
                entity.ToTable("columnmanagement");

                entity.Property(e => e.ColumnManagementId).HasColumnType("int(11)");

                entity.Property(e => e.ColumnCount)
                    .HasColumnType("int(11)")
                    .HasColumnName("columnCount");

                entity.Property(e => e.ColumnName).HasMaxLength(30);

                entity.Property(e => e.Prefix).HasMaxLength(30);

                entity.Property(e => e.ResponsiblePerson).HasMaxLength(30);

                entity.Property(e => e.RidgepoleId).HasColumnType("int(11)");

                entity.Property(e => e.RidgepoleTypeId).HasColumnType("int(11)");

                entity.Property(e => e.StartingNumbering).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Contact>(entity =>
            {
                entity.ToTable("contact");

                entity.Property(e => e.ContactId).HasColumnType("int(11)");

                entity.Property(e => e.ContactEmail).HasMaxLength(30);

                entity.Property(e => e.ContactPhone).HasMaxLength(50);

                entity.Property(e => e.ContactPlace).HasMaxLength(40);

                entity.Property(e => e.ContactQq)
                    .HasMaxLength(30)
                    .HasColumnName("ContactQQ");

                entity.Property(e => e.ContactWx)
                    .HasMaxLength(30)
                    .HasColumnName("ContactWX");
            });

            modelBuilder.Entity<Customerinformation>(entity =>
            {
                entity.ToTable("customerinformation");

                entity.Property(e => e.CustomerInformationId)
                    .HasColumnType("int(11)")
                    .ValueGeneratedNever();

                entity.Property(e => e.AffiliatedUnit).HasMaxLength(50);

                entity.Property(e => e.ChargePersonName).HasMaxLength(50);

                entity.Property(e => e.ChargePersonPhone).HasMaxLength(50);

                entity.Property(e => e.CollectionFile).HasMaxLength(50);

                entity.Property(e => e.CreateBy).HasMaxLength(50);

                entity.Property(e => e.CustomLabel).HasMaxLength(50);

                entity.Property(e => e.CustomerLevel).HasColumnType("int(11)");

                entity.Property(e => e.CustomerName).HasMaxLength(50);

                entity.Property(e => e.CustomerStage).HasMaxLength(50);

                entity.Property(e => e.CustomerType).HasColumnType("int(11)");

                entity.Property(e => e.IdentityCard).HasMaxLength(50);

                entity.Property(e => e.Industry).HasMaxLength(50);

                entity.Property(e => e.IntendedProduct).HasMaxLength(50);

                entity.Property(e => e.Location).HasMaxLength(50);

                entity.Property(e => e.Market).HasMaxLength(50);

                entity.Property(e => e.MnemonicCode).HasMaxLength(50);

                entity.Property(e => e.Remark).HasMaxLength(50);

                entity.Property(e => e.Salesman).HasMaxLength(50);

                entity.Property(e => e.SocialCreditCode).HasMaxLength(50);

                entity.Property(e => e.SuperiorCustomer).HasMaxLength(50);

                entity.Property(e => e.UpdateBy).HasMaxLength(50);

                entity.Property(e => e.UseCondition).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Deathmodel>(entity =>
            {
                entity.HasKey(e => e.DeathId)
                    .HasName("PRIMARY");

                entity.ToTable("deathmodel");

                entity.Property(e => e.DeathId).HasColumnType("int(11)");

                entity.Property(e => e.BuildingManagementId).HasColumnType("int(11)");

                entity.Property(e => e.ColumnManagementId).HasColumnType("int(11)");

                entity.Property(e => e.CreateBy).HasMaxLength(30);

                entity.Property(e => e.DeathType).HasColumnType("int(11)");

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.LogicalDeletion).HasColumnType("bit(1)");

                entity.Property(e => e.ReproductiveState).HasColumnType("int(11)");

                entity.Property(e => e.SheepRescissionSex).HasColumnType("bit(1)");

                entity.Property(e => e.UpdateBy).HasMaxLength(30);

                entity.Property(e => e.Variety).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Deliverypromptmodel>(entity =>
            {
                entity.HasKey(e => e.DeliveryPromptId)
                    .HasName("PRIMARY");

                entity.ToTable("deliverypromptmodel");

                entity.Property(e => e.DeliveryPromptId)
                    .HasColumnType("int(11)")
                    .HasComment("主键Id，自增");

                entity.Property(e => e.CurrentBuilding)
                    .HasColumnType("int(11)")
                    .HasComment("栋舍");

                entity.Property(e => e.CurrentField)
                    .HasColumnType("int(11)")
                    .HasComment("栏位");

                entity.Property(e => e.EarTag)
                    .HasMaxLength(30)
                    .HasComment("种母可视耳号");

                entity.Property(e => e.HybridizationDate)
                    .HasColumnType("datetime")
                    .HasComment("配种日期");

                entity.Property(e => e.IncidentDate)
                    .HasColumnType("datetime")
                    .HasComment("事件日期");

                entity.Property(e => e.PrelaborDate)
                    .HasColumnType("datetime")
                    .HasComment("预产日期");

                entity.Property(e => e.PromptType)
                    .HasColumnType("int(11)")
                    .HasComment("提示类型(1-待配种,2-首次妊检,3-分娩)");

                entity.Property(e => e.State)
                    .HasColumnType("int(11)")
                    .HasComment("状态(繁殖,妊检)");

                entity.Property(e => e.StateDays)
                    .HasColumnType("int(11)")
                    .HasComment("妊娠天数");

                entity.Property(e => e.Type)
                    .HasColumnType("int(11)")
                    .HasComment("类型(提示,警告)");
            });

            modelBuilder.Entity<Department>(entity =>
            {
                entity.HasKey(e => e.DepartId)
                    .HasName("PRIMARY");

                entity.ToTable("department");

                entity.Property(e => e.DepartId).HasColumnType("int(11)");

                entity.Property(e => e.CreateName).HasMaxLength(50);

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.DepartLevel).HasMaxLength(30);

                entity.Property(e => e.DepartName).HasMaxLength(50);

                entity.Property(e => e.DepartState).HasColumnType("int(11)");

                entity.Property(e => e.DepartTypeId).HasColumnType("int(11)");

                entity.Property(e => e.Isdelete).HasColumnType("bit(1)");

                entity.Property(e => e.Pid).HasColumnType("int(11)");

                entity.Property(e => e.UpdateName).HasMaxLength(50);

                entity.Property(e => e.UpdateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UpdateTIme");
            });

            modelBuilder.Entity<Descendanttransfer>(entity =>
            {
                entity.HasKey(e => e.DescendantId)
                    .HasName("PRIMARY");

                entity.ToTable("descendanttransfer");

                entity.Property(e => e.DescendantId).HasColumnType("int(11)");

                entity.Property(e => e.CreateName).HasMaxLength(50);

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.CurrentBuilding).HasColumnType("int(11)");

                entity.Property(e => e.CurrentField).HasColumnType("int(11)");

                entity.Property(e => e.DescendantDate).HasColumnType("datetime");

                entity.Property(e => e.DescendantSex).HasColumnType("bit(1)");

                entity.Property(e => e.EarTag).HasMaxLength(50);

                entity.Property(e => e.IsDel).HasColumnType("bit(1)");

                entity.Property(e => e.ToBuildingManageId).HasColumnType("int(11)");

                entity.Property(e => e.ToColumMangementId).HasColumnType("int(11)");

                entity.Property(e => e.UpdateName).HasMaxLength(50);

                entity.Property(e => e.UpdateTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<Eartag>(entity =>
            {
                entity.ToTable("eartag");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.AfterNumber).HasMaxLength(255);

                entity.Property(e => e.BeforNumber).HasMaxLength(255);

                entity.Property(e => e.EarTagBirthStatus).HasColumnType("int(11)");

                entity.Property(e => e.EarTagBreeds).HasColumnType("int(11)");

                entity.Property(e => e.EarTagInHouseDate).HasColumnType("datetime(1)");

                entity.Property(e => e.EarTagNumber).HasMaxLength(255);

                entity.Property(e => e.EarTagUseStatus).HasColumnType("bit(1)");

                entity.Property(e => e.Isdel).HasColumnType("bit(1)");
            });

            modelBuilder.Entity<Eartagormarkid>(entity =>
            {
                entity.HasKey(e => e.EarTagOrMarkId1)
                    .HasName("PRIMARY");

                entity.ToTable("eartagormarkid");

                entity.Property(e => e.EarTagOrMarkId1)
                    .HasColumnType("int(11)")
                    .HasColumnName("EarTagOrMarkId");

                entity.Property(e => e.EarTagId).HasColumnType("int(11)");

                entity.Property(e => e.MarkId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Educationalexperience>(entity =>
            {
                entity.ToTable("educationalexperience");

                entity.Property(e => e.EducationalExperienceId)
                    .HasColumnType("int(11)")
                    .HasComment("教育经历ID，主键");

                entity.Property(e => e.Education)
                    .HasMaxLength(30)
                    .HasComment("学历");

                entity.Property(e => e.EndSchool)
                    .HasMaxLength(30)
                    .HasComment("毕业学院");

                entity.Property(e => e.EndTime).HasComment("毕业时间");

                entity.Property(e => e.Intake).HasComment("入学时间");

                entity.Property(e => e.Speciality)
                    .HasMaxLength(40)
                    .HasComment("专业");

                entity.Property(e => e.SpecialityDesc)
                    .HasMaxLength(100)
                    .HasComment("专业描述");
            });

            modelBuilder.Entity<Eleartag>(entity =>
            {
                entity.ToTable("eleartag");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.ElEarTagContent)
                    .HasColumnType("text")
                    .HasColumnName("ElEarTag_Content");

                entity.Property(e => e.ElEarTagMarkReason)
                    .HasMaxLength(255)
                    .HasColumnName("ElEarTag_MarkReason");

                entity.Property(e => e.ElEarTagNumber)
                    .HasMaxLength(255)
                    .HasColumnName("ElEarTag_Number");

                entity.Property(e => e.ElEarTagStatus).HasColumnName("ElEarTag_Status");

                entity.Property(e => e.NewEleTagNumber)
                    .HasMaxLength(255)
                    .HasColumnName("NewEleTag_Number");
            });

            modelBuilder.Entity<Eleartagoreartag>(entity =>
            {
                entity.ToTable("eleartagoreartag");

                entity.Property(e => e.Id).HasColumnType("int(11)");

                entity.Property(e => e.EarTagNumber)
                    .HasMaxLength(255)
                    .HasColumnName("EarTag_Number");

                entity.Property(e => e.ElEarTagNumber)
                    .HasMaxLength(255)
                    .HasColumnName("ElEarTag_Number");
            });

            modelBuilder.Entity<Eliminationmodel>(entity =>
            {
                entity.HasKey(e => e.EliminationId)
                    .HasName("PRIMARY");

                entity.ToTable("eliminationmodel");

                entity.Property(e => e.EliminationId).HasColumnType("int");

                entity.Property(e => e.BuildingManagementId).HasColumnType("int(11)");

                entity.Property(e => e.ColumnManagementId).HasColumnType("int(11)");

                entity.Property(e => e.CreateBy).HasMaxLength(30);

                entity.Property(e => e.DepartureState).HasColumnType("bit(1)");

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.LogicalDeletion).HasColumnType("bit(1)");

                entity.Property(e => e.ReproductiveState).HasColumnType("int(11)");

                entity.Property(e => e.SheepRescissionSex).HasColumnType("bit(1)");

                entity.Property(e => e.Siwang).HasMaxLength(30);

                entity.Property(e => e.TreatmentMeasure).HasColumnType("int(11)");

                entity.Property(e => e.UpdateBy).HasMaxLength(30);

                entity.Property(e => e.Variety).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Emergencycontact>(entity =>
            {
                entity.ToTable("emergencycontact");

                entity.Property(e => e.EmergencyContactId).HasColumnType("int(11)");

                entity.Property(e => e.ContactPlace).HasMaxLength(40);

                entity.Property(e => e.ContactWx)
                    .HasMaxLength(30)
                    .HasColumnName("ContactWX");

                entity.Property(e => e.EmergencyContactName).HasMaxLength(50);

                entity.Property(e => e.EmergencyContactPhone).HasMaxLength(30);

                entity.Property(e => e.EmergencyContactPlace).HasMaxLength(30);
            });

            modelBuilder.Entity<Entryinformation>(entity =>
            {
                entity.ToTable("entryinformation");

                entity.Property(e => e.EntryInformationId).HasColumnType("int(11)");

                entity.Property(e => e.DepartmentId)
                    .HasColumnType("int(11)")
                    .HasColumnName("department_id");

                entity.Property(e => e.EmployeeStatus)
                    .HasColumnType("int(11)")
                    .HasColumnName("employee_status");

                entity.Property(e => e.HireDate)
                    .HasColumnType("datetime")
                    .HasColumnName("hire_date");

                entity.Property(e => e.JobTitle)
                    .HasMaxLength(255)
                    .HasColumnName("job_title");

                entity.Property(e => e.PersonnelLevel)
                    .HasMaxLength(50)
                    .HasColumnName("personnel_level");

                entity.Property(e => e.Position)
                    .HasMaxLength(255)
                    .HasColumnName("position");

                entity.Property(e => e.RegularizationDate)
                    .HasColumnType("datetime")
                    .HasColumnName("regularization_date");

                entity.Property(e => e.UnitId)
                    .HasColumnType("int(11)")
                    .HasColumnName("unit_id");

                entity.Property(e => e.UserId)
                    .HasColumnType("int(11)")
                    .HasColumnName("userId");
            });

            modelBuilder.Entity<Familyrelationship>(entity =>
            {
                entity.HasKey(e => e.FamilyRelationshipsId)
                    .HasName("PRIMARY");

                entity.ToTable("familyrelationships");

                entity.Property(e => e.FamilyRelationshipsId).HasColumnType("int(11)");

                entity.Property(e => e.FamilyDuties).HasMaxLength(40);

                entity.Property(e => e.FamilyFace).HasMaxLength(100);

                entity.Property(e => e.FamilyName).HasMaxLength(30);

                entity.Property(e => e.FamilyPhone).HasMaxLength(30);

                entity.Property(e => e.FamilyRelationship1)
                    .HasMaxLength(30)
                    .HasColumnName("FamilyRelationship");

                entity.Property(e => e.FamilyWorkPlace).HasMaxLength(30);
            });

            modelBuilder.Entity<Gestationpromptmodel>(entity =>
            {
                entity.HasKey(e => e.GestationPromptId)
                    .HasName("PRIMARY");

                entity.ToTable("gestationpromptmodel");

                entity.Property(e => e.GestationPromptId).HasColumnType("int(11)");

                entity.Property(e => e.BuildingName).HasMaxLength(30);

                entity.Property(e => e.ColumnName).HasMaxLength(30);

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.GestationDays).HasColumnType("int(11)");

                entity.Property(e => e.IncidentDate).HasColumnType("datetime");

                entity.Property(e => e.PromptType).HasColumnType("int(11)");

                entity.Property(e => e.State).HasColumnType("int(11)");

                entity.Property(e => e.Type).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Historyrecord>(entity =>
            {
                entity.HasKey(e => e.Hrid)
                    .HasName("PRIMARY");

                entity.ToTable("historyrecord");

                entity.Property(e => e.Hrid)
                    .HasColumnType("int(11)")
                    .HasColumnName("HRId");

                entity.Property(e => e.BreedDate).HasColumnType("datetime");

                entity.Property(e => e.BreedingRaw)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.CreateName)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.CurrentPregnancy).HasColumnType("int(11)");

                entity.Property(e => e.DeliveryDate).HasColumnType("datetime");

                entity.Property(e => e.EarTag)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.FreaksNumber).HasColumnType("int(11)");

                entity.Property(e => e.HealthyNumber).HasColumnType("int(11)");

                entity.Property(e => e.HealthyTotalWeight).HasPrecision(10);

                entity.Property(e => e.Isdel).HasColumnType("bit(1)");

                entity.Property(e => e.LambNumber).HasColumnType("int(11)");

                entity.Property(e => e.MalformationNumber).HasColumnType("int(11)");

                entity.Property(e => e.MummyNumber).HasColumnType("int(11)");

                entity.Property(e => e.PregnancyDate).HasColumnType("datetime");

                entity.Property(e => e.PregnancyResult).HasColumnType("int(11)");

                entity.Property(e => e.StillbirthNumber).HasColumnType("int(11)");

                entity.Property(e => e.UpdateName)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.UpdateTime).HasColumnType("datetime");

                entity.Property(e => e.WeaningCount).HasColumnType("int(11)");

                entity.Property(e => e.WeaningDate).HasColumnType("datetime");

                entity.Property(e => e.WeaningWeight).HasPrecision(10);
            });

            modelBuilder.Entity<Hybridizationpromptmodel>(entity =>
            {
                entity.HasKey(e => e.HybridizationPromptId)
                    .HasName("PRIMARY");

                entity.ToTable("hybridizationpromptmodel");

                entity.Property(e => e.HybridizationPromptId).HasColumnType("int(11)");

                entity.Property(e => e.BuildingName).HasMaxLength(30);

                entity.Property(e => e.ColumnName).HasMaxLength(30);

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.IncidentDate).HasColumnType("datetime");

                entity.Property(e => e.PromptType).HasColumnType("int(11)");

                entity.Property(e => e.State).HasColumnType("int(11)");

                entity.Property(e => e.StateDays).HasColumnType("int(11)");

                entity.Property(e => e.Type).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Lambweaninginfo>(entity =>
            {
                entity.HasKey(e => e.LambWeaningId)
                    .HasName("PRIMARY");

                entity.ToTable("lambweaninginfo");

                entity.Property(e => e.LambWeaningId).HasColumnType("int(11)");

                entity.Property(e => e.CreateName).HasMaxLength(50);

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.CurrentBuilding).HasColumnType("int(11)");

                entity.Property(e => e.CurrentField).HasColumnType("int(11)");

                entity.Property(e => e.EarTag).HasMaxLength(50);

                entity.Property(e => e.IsDel).HasColumnType("bit(1)");

                entity.Property(e => e.MammalianNumber).HasMaxLength(50);

                entity.Property(e => e.Parity).HasColumnType("int(11)");

                entity.Property(e => e.Sex).HasColumnType("bit(1)");

                entity.Property(e => e.ToBuildingManageId).HasColumnType("int(11)");

                entity.Property(e => e.ToColumnManagementId).HasColumnType("int(11)");

                entity.Property(e => e.UpdateName).HasMaxLength(50);

                entity.Property(e => e.UpdateTime).HasColumnType("datetime");

                entity.Property(e => e.UserId).HasColumnType("int(11)");

                entity.Property(e => e.WeaningAge).HasColumnType("int(11)");

                entity.Property(e => e.WeaningDate).HasColumnType("datetime");

                entity.Property(e => e.WeaningWeight).HasPrecision(10, 2);
            });

            modelBuilder.Entity<Management>(entity =>
            {
                entity.HasKey(e => e.EarTagId)
                    .HasName("PRIMARY");

                entity.ToTable("management");

                entity.Property(e => e.EarTagId).HasColumnType("int(11)");

                entity.Property(e => e.BirthStatus).HasMaxLength(30);

                entity.Property(e => e.Corresponding).HasMaxLength(30);

                entity.Property(e => e.CreateBy).HasMaxLength(30);

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.EarNumber).HasColumnType("int(11)");

                entity.Property(e => e.EarPrefix).HasMaxLength(30);

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.EarType).HasMaxLength(30);

                entity.Property(e => e.IsDel).HasColumnType("bit(1)");

                entity.Property(e => e.StartingLug).HasColumnType("int(11)");

                entity.Property(e => e.UpdateBy).HasMaxLength(30);

                entity.Property(e => e.UpdateDate).HasColumnType("datetime");

                entity.Property(e => e.WarehousingDate).HasColumnType("datetime");
            });

            modelBuilder.Entity<Permission>(entity =>
            {
                entity.HasKey(e => e.Perid)
                    .HasName("PRIMARY");

                entity.ToTable("permission");

                entity.Property(e => e.Perid).HasColumnType("int(11)");

                entity.Property(e => e.ComponentPath).HasMaxLength(50);

                entity.Property(e => e.Identification).HasMaxLength(80);

                entity.Property(e => e.PerName).HasMaxLength(30);

                entity.Property(e => e.PerSort).HasColumnType("int(30)");

                entity.Property(e => e.PerType).HasColumnType("int(11)");

                entity.Property(e => e.PerUrl).HasMaxLength(30);

                entity.Property(e => e.PerUrlName).HasMaxLength(30);

                entity.Property(e => e.Pid).HasColumnType("int(11)");

                entity.Property(e => e.State).HasColumnType("int(11)");

                entity.Property(e => e.IsDel).HasColumnType("bit(1)");
            });

            modelBuilder.Entity<Personnel>(entity =>
            {
                entity.ToTable("personnel");

                entity.Property(e => e.PersonnelId).HasColumnType("int(11)");

                entity.Property(e => e.OldPersonnelName).HasMaxLength(30);

                entity.Property(e => e.PersonnelFace).HasMaxLength(30);

                entity.Property(e => e.PersonnelHighLevel).HasMaxLength(30);

                entity.Property(e => e.PersonnelIdType).HasColumnType("int(11)");

                entity.Property(e => e.PersonnelInPlace).HasMaxLength(30);

                entity.Property(e => e.PersonnelName).HasMaxLength(50);

                entity.Property(e => e.PersonnelNation).HasMaxLength(50);

                entity.Property(e => e.PersonnelNature).HasMaxLength(30);

                entity.Property(e => e.PersonnelNumber).HasMaxLength(30);

                entity.Property(e => e.PersonnelPlace).HasMaxLength(20);

                entity.Property(e => e.PersonnelSchool).HasMaxLength(30);

                entity.Property(e => e.PersonnelSex).HasMaxLength(40);
            });

            modelBuilder.Entity<Promptmodel>(entity =>
            {
                entity.HasKey(e => e.PromptId)
                    .HasName("PRIMARY");

                entity.ToTable("promptmodel");

                entity.Property(e => e.PromptId).HasColumnType("int(11)");

                entity.Property(e => e.BuildingName).HasMaxLength(30);

                entity.Property(e => e.ColumnName).HasMaxLength(30);

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.IncidentDate).HasColumnType("datetime");

                entity.Property(e => e.PromptType).HasColumnType("int(11)");

                entity.Property(e => e.State).HasColumnType("int(11)");

                entity.Property(e => e.StateDays).HasColumnType("int(11)");

                entity.Property(e => e.Type).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Province>(entity =>
            {
                entity.ToTable("province");

                entity.Property(e => e.ProVinceId).HasColumnType("int(11)");

                entity.Property(e => e.ProVinceName).HasMaxLength(30);
            });

            modelBuilder.Entity<Purchaseformmodel>(entity =>
            {
                entity.HasKey(e => e.PurchaseFormId)
                    .HasName("PRIMARY");

                entity.ToTable("purchaseformmodel");

                entity.Property(e => e.PurchaseFormId).HasColumnType("int(11)");

                entity.Property(e => e.AdjustTheAmount).HasPrecision(10);

                entity.Property(e => e.Amount).HasPrecision(10);

                entity.Property(e => e.AverageUnitOnly).HasPrecision(10);

                entity.Property(e => e.BuildingId).HasColumnType("int(11)");

                entity.Property(e => e.BuildingName).HasMaxLength(50);

                entity.Property(e => e.Buyer).HasMaxLength(50);

                entity.Property(e => e.ColumnId).HasColumnType("int(11)");

                entity.Property(e => e.ColumnName).HasMaxLength(50);

                entity.Property(e => e.CreateBy).HasMaxLength(50);

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.DateOfPurchase).HasColumnType("datetime");

                entity.Property(e => e.Document).HasMaxLength(50);

                entity.Property(e => e.EarTag).HasMaxLength(50);

                entity.Property(e => e.GoodName).HasMaxLength(50);

                entity.Property(e => e.InboundQuantity).HasColumnType("int(11)");

                entity.Property(e => e.IsDel).HasColumnType("bit(1)");

                entity.Property(e => e.LabelPackage).HasMaxLength(50);

                entity.Property(e => e.PurchaseFormDesc).HasMaxLength(200);

                entity.Property(e => e.SerialNumber).HasMaxLength(50);

                entity.Property(e => e.SettlementAmount).HasPrecision(10);

                entity.Property(e => e.SheepType).HasColumnType("int(11)");

                entity.Property(e => e.SummaryEnum).HasColumnType("int(11)");

                entity.Property(e => e.TotalWeight).HasPrecision(10);

                entity.Property(e => e.UnitDiscounts).HasPrecision(10);

                entity.Property(e => e.UnitOfMeasure).HasMaxLength(50);

                entity.Property(e => e.UpdateBy).HasMaxLength(50);

                entity.Property(e => e.UpdateTime).HasColumnType("datetime");

                entity.Property(e => e.Variety).HasColumnType("int(11)");

                entity.Property(e => e.VendorSnowId).HasColumnType("int(11)");

                entity.Property(e => e.Warehouse).HasMaxLength(50);
            });

            modelBuilder.Entity<Ridgepole>(entity =>
            {
                entity.ToTable("ridgepole");

                entity.Property(e => e.RidgepoleId).HasColumnType("int(11)");

                entity.Property(e => e.CreateName).HasMaxLength(30);

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.IsDel).HasColumnType("bit(1)");

                entity.Property(e => e.ProductionPersonnel).HasMaxLength(30);

                entity.Property(e => e.Remark).HasMaxLength(30);

                entity.Property(e => e.ResponsiblePerson).HasMaxLength(30);

                entity.Property(e => e.RidgepoleName).HasMaxLength(30);

                entity.Property(e => e.RidgepoleTypeId).HasColumnType("int(11)");

                entity.Property(e => e.SheepId).HasColumnType("int(11)");

                entity.Property(e => e.State).HasColumnType("int(11)");

                entity.Property(e => e.UpdateName).HasMaxLength(30);

                entity.Property(e => e.UpdateTime)
                    .HasColumnType("datetime")
                    .ValueGeneratedOnAddOrUpdate()
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<Ridgepoletype>(entity =>
            {
                entity.ToTable("ridgepoletype");

                entity.Property(e => e.RidgepoleTypeId).HasColumnType("int(11)");

                entity.Property(e => e.RidgepoleName).HasMaxLength(30);
            });

            modelBuilder.Entity<Role>(entity =>
            {
                entity.HasKey(e => e.Rid)
                    .HasName("PRIMARY");

                entity.ToTable("role");

                entity.Property(e => e.Rid).HasColumnType("int(11)");

                entity.Property(e => e.Descibe).HasMaxLength(30);

                entity.Property(e => e.Remark).HasMaxLength(30);

                entity.Property(e => e.Rname).HasMaxLength(30);
            });

            modelBuilder.Entity<Rolepermission>(entity =>
            {
                entity.HasKey(e => e.Rpid)
                    .HasName("PRIMARY");

                entity.ToTable("rolepermission");

                entity.Property(e => e.Rpid).HasColumnType("int(11)");

                entity.Property(e => e.Perid).HasColumnType("int(11)");

                entity.Property(e => e.Rid).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Selfevaluation>(entity =>
            {
                entity.ToTable("selfevaluation");

                entity.Property(e => e.SelfEvaluationId).HasColumnType("int(11)");

                entity.Property(e => e.Annex).HasMaxLength(500);

                entity.Property(e => e.SelfDesc).HasMaxLength(100);
            });

            modelBuilder.Entity<SheepMarking>(entity =>
            {
                entity.HasKey(e => e.MarkId)
                    .HasName("PRIMARY");

                entity.ToTable("sheep_markings");

                entity.Property(e => e.MarkId).HasColumnType("int(11)");

                entity.Property(e => e.AuricleId).HasColumnType("int(11)");

                entity.Property(e => e.CreateBy).HasMaxLength(30);

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.Eitag)
                    .HasMaxLength(30)
                    .HasColumnName("EITag");

                entity.Property(e => e.MarkState).HasMaxLength(30);

                entity.Property(e => e.UpdateBy).HasMaxLength(30);

                entity.Property(e => e.UpdateDate).HasMaxLength(30);

                entity.Property(e => e.WearId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Sheepablactation>(entity =>
            {
                entity.HasKey(e => e.AblactationId)
                    .HasName("PRIMARY");

                entity.ToTable("sheepablactation");

                entity.Property(e => e.AblactationId).HasColumnType("int(11)");

                entity.Property(e => e.Ablactation).HasColumnType("datetime");

                entity.Property(e => e.AblactationCause)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.AblactationNum).HasColumnType("int(11)");

                entity.Property(e => e.AblactationWeight).HasPrecision(10, 2);

                entity.Property(e => e.AuditDate).HasColumnType("datetime");

                entity.Property(e => e.AuditName)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.BreedingWeight).HasPrecision(10, 2);

                entity.Property(e => e.CreateName)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.CurrentBuilding).HasColumnType("int(11)");

                entity.Property(e => e.CurrentField).HasColumnType("int(11)");

                entity.Property(e => e.DocumentNumber)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.EarTag)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.IsDel).HasColumnType("bit(1)");

                entity.Property(e => e.SuckleNum).HasColumnType("int(11)");

                entity.Property(e => e.ToBuildingManageId).HasColumnType("int(11)");

                entity.Property(e => e.ToColumMangementId).HasColumnType("int(11)");

                entity.Property(e => e.UpdateName)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.UpdateTime).HasColumnType("datetime");

                entity.Property(e => e.UserId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Sheepfactory>(entity =>
            {
                entity.HasKey(e => e.SheepId)
                    .HasName("PRIMARY");

                entity.ToTable("sheepfactory");

                entity.Property(e => e.SheepId).HasColumnType("int(11)");

                entity.Property(e => e.Address).HasMaxLength(50);

                entity.Property(e => e.DepartId).HasColumnType("int(11)");

                entity.Property(e => e.EstablishingTime).HasColumnType("datetime");

                entity.Property(e => e.Isdelete).HasColumnType("bit(1)");

                entity.Property(e => e.ResponsiblePerson).HasMaxLength(50);

                entity.Property(e => e.SheepAbbreviation).HasMaxLength(50);

                entity.Property(e => e.SheepAddr).HasMaxLength(50);

                entity.Property(e => e.SheepFullName).HasMaxLength(50);

                entity.Property(e => e.SheepNumber).HasMaxLength(50);

                entity.Property(e => e.SheepScale).HasMaxLength(50);

                entity.Property(e => e.State).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Sheepfilemodel>(entity =>
            {
                entity.HasKey(e => e.SheepFileId)
                    .HasName("PRIMARY");

                entity.ToTable("sheepfilemodel");

                entity.Property(e => e.SheepFileId)
                    .HasColumnType("int(11)")
                    .HasComment("主键（自增）");

                entity.Property(e => e.AblactationDate)
                    .HasColumnType("datetime")
                    .HasComment("断奶日期");

                entity.Property(e => e.AblactationWeight)
                    .HasPrecision(10)
                    .HasComment("断奶重");

                entity.Property(e => e.AdmissionDate)
                    .HasColumnType("datetime")
                    .HasComment("入场日期");

                entity.Property(e => e.BirthContent)
                    .HasMaxLength(100)
                    .HasComment("备注");

                entity.Property(e => e.BirthDate)
                    .HasColumnType("datetime")
                    .HasComment("出生日期");

                entity.Property(e => e.BirthPlace)
                    .HasMaxLength(100)
                    .HasComment("出生场地");

                entity.Property(e => e.BirthState)
                    .HasColumnType("int(11)")
                    .HasComment("出生状态");

                entity.Property(e => e.BirthWeight)
                    .HasPrecision(10)
                    .HasComment("出生重（公斤）");

                entity.Property(e => e.BuildingId)
                    .HasColumnType("int(11)")
                    .HasComment("栋舍");

                entity.Property(e => e.ColumnId)
                    .HasColumnType("int(11)")
                    .HasComment("栏位");

                entity.Property(e => e.CreateName)
                    .HasMaxLength(50)
                    .HasComment("创建人");

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasComment("创建时间");

                entity.Property(e => e.EarTag)
                    .HasMaxLength(30)
                    .HasComment("耳号");

                entity.Property(e => e.ElectEarNum)
                    .HasMaxLength(50)
                    .HasComment("电子耳标号");

                entity.Property(e => e.GeneticGrade)
                    .HasColumnType("int(11)")
                    .HasComment("基因等级");

                entity.Property(e => e.Growthstage)
                    .HasColumnType("int(11)")
                    .HasComment("生长阶段");

                entity.Property(e => e.IsDel)
                    .HasColumnType("bit(1)")
                    .HasComment("逻辑删除");

                entity.Property(e => e.IsPregnancy)
                    .HasColumnType("bit(1)")
                    .HasComment("是否妊检 (0 = 否, 1 = 是)");

                entity.Property(e => e.MatherEarNum)
                    .HasMaxLength(50)
                    .HasComment("母亲耳号");

                entity.Property(e => e.PrantEarNum)
                    .HasMaxLength(50)
                    .HasComment("父亲耳号");

                entity.Property(e => e.PresentState)
                    .HasColumnType("int(11)")
                    .HasComment("在场状态");

                entity.Property(e => e.ProduceLevel)
                    .HasColumnType("int(11)")
                    .HasComment("生产等级");

                entity.Property(e => e.ReproductionState)
                    .HasColumnType("int(11)")
                    .HasComment("繁殖状态");

                entity.Property(e => e.ReproductionStateNum)
                    .HasColumnType("int(11)")
                    .HasComment("繁殖状态天数");

                entity.Property(e => e.SaleLevel)
                    .HasColumnType("int(11)")
                    .HasComment("销售等级");

                entity.Property(e => e.SheepSex).HasComment("性别 (0 = 雌, 1 = 雄)");

                entity.Property(e => e.SheepType)
                    .HasColumnType("int(11)")
                    .HasComment("羊只类型");

                entity.Property(e => e.UpdateName)
                    .HasMaxLength(50)
                    .HasComment("修改人");

                entity.Property(e => e.UpdateTime)
                    .HasColumnType("datetime")
                    .HasComment("修改时间");

                entity.Property(e => e.Variety)
                    .HasColumnType("int(11)")
                    .HasComment("品种");
            });

            modelBuilder.Entity<Sheeppregnancy>(entity =>
            {
                entity.HasKey(e => e.PregnancyId)
                    .HasName("PRIMARY");

                entity.ToTable("sheeppregnancy");

                entity.Property(e => e.PregnancyId)
                    .HasColumnType("int(11)")
                    .HasComment("主键（自增）");

                entity.Property(e => e.AuditDate)
                    .HasColumnType("datetime")
                    .HasComment("审核时间");

                entity.Property(e => e.AuditName)
                    .HasMaxLength(50)
                    .HasComment("审核人");

                entity.Property(e => e.CreateName)
                    .HasMaxLength(50)
                    .HasComment("创建人");

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasComment("创建时间");

                entity.Property(e => e.CurrentBuilding)
                    .HasColumnType("int(11)")
                    .HasComment("当前栋舍");

                entity.Property(e => e.CurrentField)
                    .HasColumnType("int(11)")
                    .HasComment("当前栏位");

                entity.Property(e => e.DocumentNumber)
                    .HasMaxLength(50)
                    .HasComment("单据号");

                entity.Property(e => e.EarTag)
                    .HasMaxLength(50)
                    .HasComment("耳号");

                entity.Property(e => e.IsDel)
                    .HasColumnType("bit(1)")
                    .HasComment("逻辑删除");

                entity.Property(e => e.ParityNum)
                    .HasColumnType("int(11)")
                    .HasComment("同胎数");

                entity.Property(e => e.PregnancyContext)
                    .HasMaxLength(50)
                    .HasComment("备注");

                entity.Property(e => e.PregnancyDate)
                    .HasColumnType("datetime")
                    .HasComment("妊检日期");

                entity.Property(e => e.PregnancyManner)
                    .HasColumnType("int(11)")
                    .HasComment("妊检方式");

                entity.Property(e => e.PregnancyNum)
                    .HasColumnType("int(11)")
                    .HasColumnName("pregnancyNum")
                    .HasComment("妊娠天数");

                entity.Property(e => e.PregnancyResult)
                    .HasColumnType("int(11)")
                    .HasComment("妊检结果");

                entity.Property(e => e.ToBuildingManageId)
                    .HasColumnType("int(11)")
                    .HasComment("转入栋舍");

                entity.Property(e => e.ToColumMangementId)
                    .HasColumnType("int(11)")
                    .HasComment("转入栏位");

                entity.Property(e => e.UpdateName)
                    .HasMaxLength(50)
                    .HasComment("修改人");

                entity.Property(e => e.UpdateTime)
                    .HasColumnType("datetime")
                    .HasComment("修改时间");

                entity.Property(e => e.UserId)
                    .HasColumnType("int(11)")
                    .HasComment("负责人");
            });

            modelBuilder.Entity<Sheeprescission>(entity =>
            {
                entity.ToTable("sheeprescission");

                entity.Property(e => e.SheepRescissionId).HasColumnType("int(11)");

                entity.Property(e => e.CreateName)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.DocumentNumber)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.EarTag)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.Isdel).HasColumnType("bit(1)");

                entity.Property(e => e.OutBuildingManageId).HasColumnType("int(11)");

                entity.Property(e => e.OutColumMangementId).HasColumnType("int(11)");

                entity.Property(e => e.RoundType).HasColumnType("int(11)");

                entity.Property(e => e.SheepRescissionDate).HasColumnType("datetime");

                entity.Property(e => e.SheepRescissionSex).HasColumnType("bit(1)");

                entity.Property(e => e.SheepType).HasColumnType("int(11)");

                entity.Property(e => e.ToBuildingManageId)
                    .HasColumnType("int(11)")
                    .HasColumnName("ToBuildingManageId      ");

                entity.Property(e => e.ToColumMangementId).HasColumnType("int(11)");

                entity.Property(e => e.UpdateName)
                    .HasMaxLength(50)
                    .UseCollation("utf8_general_ci")
                    .HasCharSet("utf8");

                entity.Property(e => e.UpdateTime).HasColumnType("datetime");

                entity.Property(e => e.Variety).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Sheepsalemodel>(entity =>
            {
                entity.HasKey(e => e.SheepSaleId)
                    .HasName("PRIMARY");

                entity.ToTable("sheepsalemodel");

                entity.Property(e => e.SheepSaleId)
                    .HasColumnType("int(11)")
                    .ValueGeneratedNever();

                entity.Property(e => e.Address).HasColumnType("int(11)");

                entity.Property(e => e.BirthDate).HasColumnType("datetime");

                entity.Property(e => e.BirthWeight).HasPrecision(6, 2);

                entity.Property(e => e.BuildingName).HasMaxLength(50);

                entity.Property(e => e.CheckDate).HasColumnType("datetime");

                entity.Property(e => e.CheckPeople).HasMaxLength(50);

                entity.Property(e => e.CheckState).HasColumnType("int(11)");

                entity.Property(e => e.ClosingPrice).HasPrecision(10, 2);

                entity.Property(e => e.ColumnName).HasMaxLength(50);

                entity.Property(e => e.CreateBy).HasMaxLength(255);

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.CustomerInformationId).HasColumnType("int(11)");

                entity.Property(e => e.DiscountRatio).HasPrecision(5, 2);

                entity.Property(e => e.DocId).HasColumnType("int(11)");

                entity.Property(e => e.DocNumber).HasColumnType("int(11)");

                entity.Property(e => e.EarTag).HasMaxLength(50);

                entity.Property(e => e.FixPrice).HasPrecision(10, 2);

                entity.Property(e => e.Grade).HasColumnType("int(11)");

                entity.Property(e => e.MarkId).HasColumnType("int(11)");

                entity.Property(e => e.MoneyCheckDate).HasColumnType("datetime");

                entity.Property(e => e.MoneyCheckPeople).HasMaxLength(50);

                entity.Property(e => e.MonthsAge).HasColumnType("int(11)");

                entity.Property(e => e.MotherEitag)
                    .HasMaxLength(50)
                    .HasColumnName("MotherEITag");

                entity.Property(e => e.OfficialRank).HasColumnType("int(11)");

                entity.Property(e => e.ParentEitag)
                    .HasMaxLength(50)
                    .HasColumnName("ParentEITag");

                entity.Property(e => e.ReproductiveState).HasColumnType("int(11)");

                entity.Property(e => e.SaleDate).HasColumnType("datetime");

                entity.Property(e => e.SaleId).HasColumnType("int(11)");

                entity.Property(e => e.SheepFileId).HasColumnType("int(11)");

                entity.Property(e => e.SheepType).HasColumnType("int(11)");

                entity.Property(e => e.UpdateBy).HasMaxLength(255);

                entity.Property(e => e.UpdateDate).HasColumnType("datetime");

                entity.Property(e => e.WeaningWeight).HasPrecision(6, 2);

                entity.Property(e => e.WorkShopCheckDate).HasColumnType("datetime");

                entity.Property(e => e.WorkShopCheckPeople).HasMaxLength(50);

                entity.Property(e => e.WorkShopId).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Start>(entity =>
            {
                entity.ToTable("start");

                entity.Property(e => e.StartId).HasColumnType("int(11)");

                entity.Property(e => e.ColumnManagementId).HasColumnType("int(11)");

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.CreateName).HasMaxLength(30);

                entity.Property(e => e.DocumentNumber).HasMaxLength(30);

                entity.Property(e => e.EarTag).HasMaxLength(30);

                entity.Property(e => e.Isdel).HasColumnType("bit(1)");

                entity.Property(e => e.OnlyNumber).HasColumnType("int(11)");

                entity.Property(e => e.OpeningDate).HasColumnType("datetime");

                entity.Property(e => e.Remark).HasMaxLength(30);

                entity.Property(e => e.ReplantingDate).HasColumnType("datetime");

                entity.Property(e => e.RidgepoleId).HasColumnType("int(11)");

                entity.Property(e => e.Stage).HasColumnType("int(11)");

                entity.Property(e => e.Type).HasColumnType("int(11)");

                entity.Property(e => e.UpdateDate).HasColumnType("datetime");

                entity.Property(e => e.UpdateName).HasMaxLength(30);

                entity.Property(e => e.Weight).HasPrecision(10, 2);
            });

            modelBuilder.Entity<Unit>(entity =>
            {
                entity.HasKey(e => e.CompanyId)
                    .HasName("PRIMARY");

                entity.ToTable("unit");

                entity.Property(e => e.CompanyId).HasColumnType("int(11)");

                entity.Property(e => e.AccountingUnit).HasColumnType("int(11)");

                entity.Property(e => e.Addr).HasMaxLength(50);

                entity.Property(e => e.AreaId).HasColumnType("int(11)");

                entity.Property(e => e.CompanyAbbreviation).HasMaxLength(30);

                entity.Property(e => e.CompanyLabel).HasMaxLength(50);

                entity.Property(e => e.CompanyLogo).HasMaxLength(50);

                entity.Property(e => e.CompanyName).HasMaxLength(30);

                entity.Property(e => e.CompanyNode).HasMaxLength(50);

                entity.Property(e => e.CompanyPhone).HasMaxLength(50);

                entity.Property(e => e.Describee).HasMaxLength(50);

                entity.Property(e => e.FinancePerson).HasMaxLength(50);

                entity.Property(e => e.Isdelete).HasColumnType("bit(1)");

                entity.Property(e => e.LookPerson).HasColumnType("int(11)");

                entity.Property(e => e.ResponsibilitiesPerson).HasMaxLength(50);

                entity.Property(e => e.ResponsiblePerson).HasMaxLength(50);
            });

            modelBuilder.Entity<Userinfo>(entity =>
            {
                entity.HasKey(e => e.Uid)
                    .HasName("PRIMARY");

                entity.ToTable("userinfo");

                entity.Property(e => e.Uid).HasColumnType("int(11)");

                entity.Property(e => e.Addr).HasMaxLength(30);

                entity.Property(e => e.CardNumber).HasMaxLength(30);

                entity.Property(e => e.CardType).HasMaxLength(30);

                entity.Property(e => e.EducationBackground).HasMaxLength(30);

                entity.Property(e => e.Email).HasMaxLength(30);

                entity.Property(e => e.GraduateInstitutions).HasMaxLength(30);

                entity.Property(e => e.Name).HasMaxLength(30);

                entity.Property(e => e.NickName).HasMaxLength(30);

                entity.Property(e => e.PartMent).HasMaxLength(30);

                entity.Property(e => e.Phone).HasMaxLength(30);

                entity.Property(e => e.Uname).HasMaxLength(30);

                entity.Property(e => e.Upwd).HasMaxLength(30);

                entity.Property(e => e.Ustae).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Userrole>(entity =>
            {
                entity.HasKey(e => e.Urid)
                    .HasName("PRIMARY");

                entity.ToTable("userrole");

                entity.Property(e => e.Urid).HasColumnType("int(11)");

                entity.Property(e => e.Rid).HasColumnType("int(11)");

                entity.Property(e => e.Uid).HasColumnType("int(11)");
            });

            modelBuilder.Entity<Vendormodel>(entity =>
            {
                entity.HasKey(e => e.VendorSnowId)
                    .HasName("PRIMARY");

                entity.ToTable("vendormodel");

                entity.Property(e => e.VendorSnowId).HasColumnType("int(11)");

                entity.Property(e => e.ArearAdd).HasMaxLength(200);

                entity.Property(e => e.BusinessId).HasColumnType("int(11)");

                entity.Property(e => e.CreateBy).HasColumnType("int(11)");

                entity.Property(e => e.CreateTime).HasColumnType("datetime");

                entity.Property(e => e.IdentityCard).HasMaxLength(50);

                entity.Property(e => e.IndustryName).HasMaxLength(50);

                entity.Property(e => e.IsDel).HasColumnType("bit(1)");

                entity.Property(e => e.Markets).HasMaxLength(50);

                entity.Property(e => e.Mnemonics).HasMaxLength(100);

                entity.Property(e => e.ResponsibleName).HasMaxLength(50);

                entity.Property(e => e.ResponsiblePhone).HasMaxLength(50);

                entity.Property(e => e.Salesman).HasMaxLength(50);

                entity.Property(e => e.UnifiedSocialCreditCode).HasMaxLength(100);

                entity.Property(e => e.UnitsOfReference).HasMaxLength(50);

                entity.Property(e => e.UpdateBy).HasColumnType("int(11)");

                entity.Property(e => e.UpdateTime).HasColumnType("datetime");

                entity.Property(e => e.UseState).HasColumnType("bit(1)");

                entity.Property(e => e.VenDorCode).HasMaxLength(50);

                entity.Property(e => e.VendorAttributes).HasMaxLength(100);

                entity.Property(e => e.VendorDesc).HasMaxLength(200);

                entity.Property(e => e.VendorName).HasMaxLength(50);

                entity.Property(e => e.VendorType).HasMaxLength(50);
            });

            modelBuilder.Entity<Workexperience>(entity =>
            {
                entity.ToTable("workexperience");

                entity.Property(e => e.WorkExperienceId).HasColumnType("int(11)");

                entity.Property(e => e.Department).HasMaxLength(30);

                entity.Property(e => e.LeaveReason).HasMaxLength(100);

                entity.Property(e => e.WorkContent).HasMaxLength(30);

                entity.Property(e => e.WorkUnit).HasMaxLength(30);
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
